# Copyright (C) 2022 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file is automatically generated by tools/gen_bazel. Do not edit.

load("@perfetto_cfg//:perfetto_cfg.bzl", "PERFETTO_CONFIG")
load(
    "@perfetto//bazel:rules.bzl",
    "perfetto_py_binary",
    "perfetto_py_library",
)

licenses(["notice"])

package(default_visibility = [PERFETTO_CONFIG.root + ":__subpackages__"])

# GN target: //python:batch_trace_processor
perfetto_py_library(
    name = "batch_trace_processor",
    srcs = [
        "perfetto/batch_trace_processor/__init__.py",
        "perfetto/batch_trace_processor/api.py",
        "perfetto/batch_trace_processor/platform.py",
    ],
    visibility = [
        "//visibility:public",
    ],
    deps = [
               ":trace_processor_py",
           ] + PERFETTO_CONFIG.deps.pandas_py +
           PERFETTO_CONFIG.deps.tp_vendor_py,
)

# GN target: //python:experimental_slice_breakdown_bin
perfetto_py_binary(
    name = "experimental_slice_breakdown_bin",
    srcs = [
        "tools/slice_breakdown.py",
    ],
    deps = [
        ":experimental_slice_breakdown_lib",
        ":trace_processor_py",
    ] + PERFETTO_CONFIG.deps.pandas_py,
    main = "tools/slice_breakdown.py",
)

# GN target: //python:trace_processor_table_generator
perfetto_py_library(
    name = "trace_processor_table_generator",
    srcs = [
        "generators/trace_processor_table/public.py",
        "generators/trace_processor_table/serialize.py",
        "generators/trace_processor_table/serialize_new.py",
        "generators/trace_processor_table/util.py",
    ],
)

# GN target: //python:trace_processor_py_example
perfetto_py_binary(
    name = "trace_processor_py_example",
    srcs = [
        "example.py",
    ],
    deps = [
        ":trace_processor_py",
    ] + PERFETTO_CONFIG.deps.pandas_py,
    main = "example.py",
)

# GN target: //python:sql_processing
perfetto_py_library(
    name = "sql_processing",
    srcs = [
        "generators/sql_processing/docs_extractor.py",
        "generators/sql_processing/docs_parse.py",
        "generators/sql_processing/utils.py",
    ],
)

# GN target: //python:common
perfetto_py_library(
    name = "common",
    srcs = [
        "perfetto/common/exceptions.py",
        "perfetto/common/query_result_iterator.py",
    ],
)

# GN target: //python:experimental_slice_breakdown_lib
perfetto_py_library(
    name = "experimental_slice_breakdown_lib",
    srcs = [
        "perfetto/experimental/slice_breakdown/__init__.py",
        "perfetto/experimental/slice_breakdown/breakdown.py",
    ],
    deps = [
        ":trace_processor_py",
    ],
)

# GN target: //python:trace_processor_py
perfetto_py_library(
    name = "trace_processor_py",
    visibility = [
        "//visibility:public",
    ],
    deps = [
        ":trace_processor_py_no_resolvers",
    ] + PERFETTO_CONFIG.deps.tp_resolvers_py,
)

# GN target: //python:trace_processor_py_no_resolvers
perfetto_py_library(
    name = "trace_processor_py_no_resolvers",
    srcs = [
        "perfetto/trace_processor/__init__.py",
        "perfetto/trace_processor/api.py",
        "perfetto/trace_processor/http.py",
        "perfetto/trace_processor/platform.py",
        "perfetto/trace_processor/protos.py",
        "perfetto/trace_processor/shell.py",
    ],
    visibility = [
        "//visibility:public",
    ],
    data = [
        PERFETTO_CONFIG.root + ":trace_processor_shell",
        "perfetto/trace_processor/metrics.descriptor",
        "perfetto/trace_processor/trace_processor.descriptor",
    ],
    deps = [
               ":common",
               ":trace_uri_resolver",
           ] + PERFETTO_CONFIG.deps.pandas_py +
           PERFETTO_CONFIG.deps.protobuf_py +
           PERFETTO_CONFIG.deps.tp_vendor_py,
    tags = [
        "avoid_dep",
    ],
)

# GN target: //python:trace_uri_resolver
perfetto_py_library(
    name = "trace_uri_resolver",
    srcs = [
        "perfetto/trace_uri_resolver/__init__.py",
        "perfetto/trace_uri_resolver/path.py",
        "perfetto/trace_uri_resolver/registry.py",
        "perfetto/trace_uri_resolver/resolver.py",
        "perfetto/trace_uri_resolver/util.py",
    ],
)

